home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac Interfaces / PInterfaces / QD3DRenderer.p < prev    next >
Encoding:
Text File  |  1999-05-18  |  42.0 KB  |  1,262 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DRenderer.p
  3.  
  4.      Contains:    Q3Renderer types and routines                                          
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.6
  7.                  Release:    QuickTime 4.0
  8.  
  9.      Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DRenderer;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DRENDERER__}
  27. {$SETC __QD3DRENDERER__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DRendererIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __QD3DSET__}
  37. {$I QD3DSet.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __QD3DVIEW__}
  40. {$I QD3DView.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __RAVE__}
  43. {$I RAVE.p}
  44. {$ENDC}
  45.  
  46. {$IFC TARGET_OS_MAC }
  47. {$IFC UNDEFINED __EVENTS__}
  48. {$I Events.p}
  49. {$ENDC}
  50. {$ENDC}  {TARGET_OS_MAC}
  51.  
  52.  
  53. {$PUSH}
  54. {$ALIGN POWER}
  55. {$LibExport+}
  56.  
  57. {*****************************************************************************
  58.  **                                                                             **
  59.  **                            User Interface Things                             **
  60.  **                                                                             **
  61.  ****************************************************************************}
  62. {$IFC TARGET_OS_MAC }
  63. {
  64.  *  A callback to an application's event handling code. This is needed to    
  65.  *  support movable modal dialogs. The dialog's event filter calls this      
  66.  *  callback with events it does not handle.                                 
  67.  *  If an application handles the event it should return kQ3True.            
  68.  *  If the application does not handle the event it must return kQ3False and 
  69.  *  the dialog's event filter will pass the event to the system unhandled.   
  70.  }
  71.  
  72. TYPE
  73. {$IFC TYPED_FUNCTION_POINTERS}
  74.     TQ3MacOSDialogEventHandler = FUNCTION({CONST}VAR event: EventRecord): TQ3Boolean; C;
  75. {$ELSEC}
  76.     TQ3MacOSDialogEventHandler = ProcPtr;
  77. {$ENDC}
  78.  
  79.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  80.     TQ3DialogAnchor = RECORD
  81.         clientEventHandler:        TQ3MacOSDialogEventHandler;
  82.     END;
  83.  
  84. {$ENDC}  {TARGET_OS_MAC}
  85.  
  86. {$IFC TARGET_OS_WIN32 }
  87.  
  88. TYPE
  89.     TQ3DialogAnchor = RECORD
  90.         ownerWindow:            HWND;
  91.     END;
  92.  
  93. {$ENDC}  {TARGET_OS_WIN32}
  94.  
  95. {$IFC TARGET_OS_UNIX }
  96.  
  97. TYPE
  98.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  99.     TQ3DialogAnchor = RECORD
  100.         notUsed:                Ptr;                                    {  place holder  }
  101.     END;
  102.  
  103. {$ENDC}  {TARGET_OS_UNIX}
  104.  
  105. {*****************************************************************************
  106.  **                                                                             **
  107.  **                            Renderer Functions                                 **
  108.  **                                                                             **
  109.  ****************************************************************************}
  110. FUNCTION Q3Renderer_NewFromType(rendererObjectType: TQ3ObjectType): TQ3RendererObject; C;
  111. FUNCTION Q3Renderer_GetType(renderer: TQ3RendererObject): TQ3ObjectType; C;
  112.  
  113. { Q3Renderer_Flush has been replaced by Q3View_Flush }
  114. { Q3Renderer_Sync has been replaced by Q3View_Sync }
  115.  
  116. {
  117.  *    Q3Renderer_IsInteractive
  118.  *        Determine if this renderer is intended to be used interactively.
  119.  }
  120. FUNCTION Q3Renderer_IsInteractive(renderer: TQ3RendererObject): TQ3Boolean; C;
  121.  
  122. {
  123.  *    Q3Renderer_HasModalConfigure
  124.  *        Determine if this renderer has a modal settings dialog.
  125.  *
  126.  *    Q3Renderer_ModalConfigure
  127.  *        Have the renderer pop up a modal dialog box to configure its settings.
  128.  *    dialogAnchor - is platform specific data passed by the client to support
  129.  *      movable modal dialogs. 
  130.  *    MacOS: this is a callback to the calling application's event handler.
  131.  *      The renderer calls this function with events not handled by the 
  132.  *      settings dialog. This is necessary in order to support movable modal 
  133.  *      dialogs. An application's event handler must return kQ3True if it 
  134.  *      handles the event passed to the callback or kQ3False if not. 
  135.  *      An application which doesn't want to support a movable modal configure
  136.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  137.  *    Win32: this is the HWND of the owning window (typically an application's
  138.  *      main window).
  139.  *  canceled - returns a boolean inditacating that the user canceled the 
  140.  *    dialog.
  141.  *      
  142.  }
  143. FUNCTION Q3Renderer_HasModalConfigure(renderer: TQ3RendererObject): TQ3Boolean; C;
  144. FUNCTION Q3Renderer_ModalConfigure(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean): TQ3Status; C;
  145. {
  146.  *    Q3RendererClass_GetNickNameString
  147.  *        Allows an application to get a renderers name string, the 
  148.  *        renderer is responsible for storing this in a localizable format
  149.  *        for example as a resource.  This string can then be used to provide
  150.  *        a selection mechanism for an application (for example in a menu).
  151.  *
  152.  *        If this call returns nil in the supplied string, then the App may 
  153.  *         choose to use the class name for the renderer.  You should always 
  154.  *        try to get the name string before using the class name, since the
  155.  *        class name is not localizable.
  156.  }
  157. FUNCTION Q3RendererClass_GetNickNameString(rendererClassType: TQ3ObjectType; VAR rendererClassString: TQ3ObjectClassNameString): TQ3Status; C;
  158.  
  159. {
  160.  *    Q3Renderer_GetConfigurationData
  161.  *        Allows an application to collect private renderer configuration data
  162.  *      which it will then save. For example in a preference file or in a 
  163.  *        style template. An application should tag this data with the 
  164.  *        Renderer's object  name.
  165.  *    
  166.  *        if dataBuffer is NULL actualDataSize returns the required size in 
  167.  *        bytes of a data buffer large enough to store private data. 
  168.  *
  169.  *      bufferSize is the actual size of the memory block pointed to by 
  170.  *        dataBuffer
  171.  *
  172.  *        actualDataSize - on return the actual number of bytes written to the 
  173.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  174.  * 
  175.  }
  176. FUNCTION Q3Renderer_GetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  177. FUNCTION Q3Renderer_SetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32): TQ3Status; C;
  178.  
  179.  
  180. {*****************************************************************************
  181.  **                                                                             **
  182.  **                        Interactive Renderer Specific Functions                 **
  183.  **                                                                             **
  184.  ****************************************************************************}
  185. { CSG IDs attribute }
  186. { Object IDs, to be applied as attributes on geometries }
  187.  
  188. CONST
  189.     kQ3AttributeTypeConstructiveSolidGeometryID = 'csgi';
  190.  
  191.     kQ3SolidGeometryObjNone        = -1;
  192.     kQ3SolidGeometryObjA        = 0;
  193.     kQ3SolidGeometryObjB        = 1;
  194.     kQ3SolidGeometryObjC        = 2;
  195.     kQ3SolidGeometryObjD        = 3;
  196.     kQ3SolidGeometryObjE        = 4;
  197.  
  198. { Possible CSG equations }
  199.  
  200. TYPE
  201.     TQ3CSGEquation                 = SInt32;
  202. CONST
  203.     kQ3CSGEquationAandB            = $88888888;
  204.     kQ3CSGEquationAandnotB        = $22222222;
  205.     kQ3CSGEquationAanBonCad        = $2F222F22;
  206.     kQ3CSGEquationnotAandB        = $44444444;
  207.     kQ3CSGEquationnAaBorCanB    = $74747474;
  208.  
  209. FUNCTION Q3InteractiveRenderer_SetCSGEquation(renderer: TQ3RendererObject; equation: TQ3CSGEquation): TQ3Status; C;
  210. FUNCTION Q3InteractiveRenderer_GetCSGEquation(renderer: TQ3RendererObject; VAR equation: TQ3CSGEquation): TQ3Status; C;
  211. FUNCTION Q3InteractiveRenderer_SetPreferences(renderer: TQ3RendererObject; vendorID: LONGINT; engineID: LONGINT): TQ3Status; C;
  212. FUNCTION Q3InteractiveRenderer_GetPreferences(renderer: TQ3RendererObject; VAR vendorID: LONGINT; VAR engineID: LONGINT): TQ3Status; C;
  213. FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass(renderer: TQ3RendererObject; bypass: TQ3Boolean): TQ3Status; C;
  214. FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass(renderer: TQ3RendererObject; VAR bypass: TQ3Boolean): TQ3Status; C;
  215. FUNCTION Q3InteractiveRenderer_SetRAVEContextHints(renderer: TQ3RendererObject; RAVEContextHints: UInt32): TQ3Status; C;
  216. FUNCTION Q3InteractiveRenderer_GetRAVEContextHints(renderer: TQ3RendererObject; VAR RAVEContextHints: UInt32): TQ3Status; C;
  217. FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter(renderer: TQ3RendererObject; RAVEtextureFilterValue: UInt32): TQ3Status; C;
  218. FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter(renderer: TQ3RendererObject; VAR RAVEtextureFilterValue: UInt32): TQ3Status; C;
  219. FUNCTION Q3InteractiveRenderer_CountRAVEDrawContexts(renderer: TQ3RendererObject; VAR numRAVEContexts: UInt32): TQ3Status; C;
  220.  
  221. TYPE
  222. {$IFC TYPED_FUNCTION_POINTERS}
  223.     TQ3RaveDestroyCallback = PROCEDURE(renderer: TQ3RendererObject); C;
  224. {$ELSEC}
  225.     TQ3RaveDestroyCallback = ProcPtr;
  226. {$ENDC}
  227.  
  228. FUNCTION Q3InteractiveRenderer_GetRAVEDrawContexts(renderer: TQ3RendererObject; VAR raveDrawContextList: TQADrawContextPtr; VAR raveDrawingEnginesList: TQAEnginePtr; VAR numRAVEContexts: UInt32; raveDestroyCallback: TQ3RaveDestroyCallback): TQ3Status; C;
  229.  
  230.  
  231.  
  232. {*****************************************************************************
  233.  **                                                                             **
  234.  **                            Renderer View Tools                                 **
  235.  **                                                                             **
  236.  **                    You may only call these methods from a plug-in             **
  237.  **                                                                             **
  238.  ****************************************************************************}
  239. {
  240.  *    Call by a renderer to call the user "idle" method, with progress 
  241.  *    information.
  242.  *    
  243.  *    Pass in (view, 0, n) on first call
  244.  *    Pass in (view, 1..n-1, n) during rendering
  245.  *    Pass in (view, n, n) upon completion
  246.  *    
  247.  *    Note: The user must have supplied an idleProgress method with 
  248.  *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  249.  *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  250.  *    is called instead. (current and final are ignored, essentially.)
  251.  *
  252.  *    Returns kQ3Failure if rendering is cancelled.
  253.  }
  254. FUNCTION Q3XView_IdleProgress(view: TQ3ViewObject; current: UInt32; completed: UInt32): TQ3Status; C;
  255. {
  256.  *    Called by an asynchronous renderer when it completes a frame.
  257.  }
  258. FUNCTION Q3XView_EndFrame(view: TQ3ViewObject): TQ3Status; C;
  259.  
  260. {*****************************************************************************
  261.  **                                                                             **
  262.  **                            Renderer AttributeSet Tools                         **
  263.  **                                                                             **
  264.  **                    You may only call these methods from a plug-in             **
  265.  **                                                                             **
  266.  ****************************************************************************}
  267. {
  268.  *    Faster access to geometry attribute sets.
  269.  *    
  270.  *    Returns pointer to INTERNAL data structure for elements and attributes
  271.  *    in an attributeSet, or NULL if no attribute exists.
  272.  *    
  273.  *    For attributes of type kQ3AttributeType..., the internal data structure
  274.  *    is identical to the data structure used in Q3AttributeSet_Add.
  275.  }
  276. FUNCTION Q3XAttributeSet_GetPointer(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): Ptr; C;
  277.  
  278.  
  279. CONST
  280.     kQ3XAttributeMaskNone        = 0;
  281.     kQ3XAttributeMaskSurfaceUV    = $01;
  282.     kQ3XAttributeMaskShadingUV    = $02;
  283.     kQ3XAttributeMaskNormal        = $04;
  284.     kQ3XAttributeMaskAmbientCoefficient = $08;
  285.     kQ3XAttributeMaskDiffuseColor = $10;
  286.     kQ3XAttributeMaskSpecularColor = $20;
  287.     kQ3XAttributeMaskSpecularControl = $40;
  288.     kQ3XAttributeMaskTransparencyColor = $80;
  289.     kQ3XAttributeMaskSurfaceTangent = $0100;
  290.     kQ3XAttributeMaskHighlightState = $0200;
  291.     kQ3XAttributeMaskSurfaceShader = $0400;
  292.     kQ3XAttributeMaskCustomAttribute = $80000000;
  293.     kQ3XAttributeMaskAll        = $800007FF;
  294.     kQ3XAttributeMaskInherited    = $03FF;
  295.     kQ3XAttributeMaskInterpolated = $01FF;
  296.  
  297.  
  298. TYPE
  299.     TQ3XAttributeMask                    = UInt32;
  300. FUNCTION Q3XAttributeSet_GetMask(attributeSet: TQ3AttributeSet): TQ3XAttributeMask; C;
  301.  
  302. {*****************************************************************************
  303.  **                                                                             **
  304.  **                            Renderer Draw Context Tools                         **
  305.  **                                                                             **
  306.  ****************************************************************************}
  307.  
  308. TYPE
  309.     TQ3XDrawRegion = ^LONGINT;
  310. FUNCTION Q3XDrawContext_GetDrawRegion(drawContext: TQ3DrawContextObject; VAR drawRegion: TQ3XDrawRegion): TQ3Status; C;
  311.  
  312. TYPE
  313.     TQ3XDrawContextValidationMasks  = SInt32;
  314. CONST
  315.     kQ3XDrawContextValidationClearFlags = $00000000;
  316.     kQ3XDrawContextValidationDoubleBuffer = $01;
  317.     kQ3XDrawContextValidationShader = $02;
  318.     kQ3XDrawContextValidationClearFunction = $04;
  319.     kQ3XDrawContextValidationActiveBuffer = $08;
  320.     kQ3XDrawContextValidationInternalOffScreen = $10;
  321.     kQ3XDrawContextValidationPane = $20;
  322.     kQ3XDrawContextValidationMask = $40;
  323.     kQ3XDrawContextValidationDevice = $80;
  324.     kQ3XDrawContextValidationWindow = $0100;
  325.     kQ3XDrawContextValidationWindowSize = $0200;
  326.     kQ3XDrawContextValidationWindowClip = $0400;
  327.     kQ3XDrawContextValidationWindowPosition = $0800;
  328.     kQ3XDrawContextValidationPlatformAttributes = $1000;
  329.     kQ3XDrawContextValidationForegroundShader = $2000;
  330.     kQ3XDrawContextValidationBackgroundShader = $4000;
  331.     kQ3XDrawContextValidationColorPalette = $8000;
  332.     kQ3XDrawContextValidationAll = $FFFFFFFF;
  333.  
  334.  
  335. TYPE
  336.     TQ3XDrawContextValidation            = UInt32;
  337. FUNCTION Q3XDrawContext_ClearValidationFlags(drawContext: TQ3DrawContextObject): TQ3Status; C;
  338. FUNCTION Q3XDrawContext_GetValidationFlags(drawContext: TQ3DrawContextObject; VAR validationFlags: TQ3XDrawContextValidation): TQ3Status; C;
  339.  
  340. {*****************************************************************************
  341.  **                                                                             **
  342.  **                            Renderer Draw Region Tools                         **
  343.  **                                                                             **
  344.  ****************************************************************************}
  345.  
  346. TYPE
  347.     TQ3XDevicePixelType         = SInt32;
  348. CONST
  349.                                                                 {  These do not indicate byte ordering    }
  350.     kQ3XDevicePixelTypeInvalid    = 0;                            {  Unknown, un-initialized type      }
  351.     kQ3XDevicePixelTypeRGB32    = 1;                            {  Alpha:8 (ignored), R:8, G:8, B:8  }
  352.     kQ3XDevicePixelTypeARGB32    = 2;                            {  Alpha:8, R:8, G:8, B:8               }
  353.     kQ3XDevicePixelTypeRGB24    = 3;                            {  24 bits/pixel, R:8, G:8, B:8      }
  354.     kQ3XDevicePixelTypeRGB16    = 4;                            {  Alpha:1 (ignored), R:5, G:5, B:5  }
  355.     kQ3XDevicePixelTypeARGB16    = 5;                            {  Alpha:1, R:5, G:5, B:5               }
  356.     kQ3XDevicePixelTypeRGB16_565 = 6;                            {  16 bits/pixel, R:5, G:6, B:5      }
  357.     kQ3XDevicePixelTypeIndexed8    = 7;                            {  8-bit color table index              }
  358.     kQ3XDevicePixelTypeIndexed4    = 8;                            {  4-bit color table index              }
  359.     kQ3XDevicePixelTypeIndexed2    = 9;                            {  2-bit color table index              }
  360.     kQ3XDevicePixelTypeIndexed1    = 10;                            {  1-bit color table index              }
  361.  
  362.  
  363. TYPE
  364.     TQ3XClipMaskState             = SInt32;
  365. CONST
  366.     kQ3XClipMaskFullyExposed    = 0;
  367.     kQ3XClipMaskPartiallyExposed = 1;
  368.     kQ3XClipMaskNotExposed        = 2;
  369.  
  370.  
  371. TYPE
  372.     TQ3XColorDescriptorPtr = ^TQ3XColorDescriptor;
  373.     TQ3XColorDescriptor = RECORD
  374.         redShift:                UInt32;
  375.         redMask:                UInt32;
  376.         greenShift:                UInt32;
  377.         greenMask:                UInt32;
  378.         blueShift:                UInt32;
  379.         blueMask:                UInt32;
  380.         alphaShift:                UInt32;
  381.         alphaMask:                UInt32;
  382.     END;
  383.  
  384.     TQ3XDrawRegionDescriptorPtr = ^TQ3XDrawRegionDescriptor;
  385.     TQ3XDrawRegionDescriptor = RECORD
  386.         width:                    UInt32;
  387.         height:                    UInt32;
  388.         rowBytes:                UInt32;
  389.         pixelSize:                UInt32;
  390.         pixelType:                TQ3XDevicePixelType;
  391.         colorDescriptor:        TQ3XColorDescriptor;
  392.         bitOrder:                TQ3Endian;
  393.         byteOrder:                TQ3Endian;
  394.         clipMask:                TQ3BitmapPtr;
  395.     END;
  396.  
  397.     TQ3XDrawRegionServicesMasks  = SInt32;
  398. CONST
  399.     kQ3XDrawRegionServicesNoneFlag = 0;
  400.     kQ3XDrawRegionServicesClearFlag = $01;
  401.     kQ3XDrawRegionServicesDontLockDDSurfaceFlag = $02;
  402.  
  403.  
  404. TYPE
  405.     TQ3XDrawRegionServices                = UInt32;
  406. {$IFC TYPED_FUNCTION_POINTERS}
  407.     TQ3XDrawRegionRendererPrivateDeleteMethod = PROCEDURE(rendererPrivate: UNIV Ptr); C;
  408. {$ELSEC}
  409.     TQ3XDrawRegionRendererPrivateDeleteMethod = ProcPtr;
  410. {$ENDC}
  411.  
  412. FUNCTION Q3XDrawRegion_GetDeviceScaleX(drawRegion: TQ3XDrawRegion; VAR deviceScaleX: Single): TQ3Status; C;
  413. FUNCTION Q3XDrawRegion_GetDeviceScaleY(drawRegion: TQ3XDrawRegion; VAR deviceScaleY: Single): TQ3Status; C;
  414.  
  415. FUNCTION Q3XDrawRegion_GetDeviceOffsetX(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  416. FUNCTION Q3XDrawRegion_GetDeviceOffsetY(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  417.  
  418. FUNCTION Q3XDrawRegion_GetWindowScaleX(drawRegion: TQ3XDrawRegion; VAR windowScaleX: Single): TQ3Status; C;
  419. FUNCTION Q3XDrawRegion_GetWindowScaleY(drawRegion: TQ3XDrawRegion; VAR windowScaleY: Single): TQ3Status; C;
  420.  
  421. FUNCTION Q3XDrawRegion_GetWindowOffsetX(drawRegion: TQ3XDrawRegion; VAR windowOffsetX: Single): TQ3Status; C;
  422. FUNCTION Q3XDrawRegion_GetWindowOffsetY(drawRegion: TQ3XDrawRegion; VAR windowOffsetY: Single): TQ3Status; C;
  423. FUNCTION Q3XDrawRegion_IsActive(drawRegion: TQ3XDrawRegion; VAR isActive: TQ3Boolean): TQ3Status; C;
  424.  
  425. FUNCTION Q3XDrawRegion_GetNextRegion(drawRegion: TQ3XDrawRegion; VAR nextDrawRegion: TQ3XDrawRegion): TQ3Status; C;
  426.  *  One of the next two functions must be called before using a draw region 
  427.  }
  428. {
  429.  *    Use this Start function if double buffering/image access services from the
  430.  *    Draw Context are not needed, you may still request clear for example
  431.  }
  432. FUNCTION Q3XDrawRegion_Start(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr): TQ3Status; C;
  433. {
  434.  *    Use this Start function if double buffering or image access services from 
  435.  *  the Draw Context are needed.
  436.  }
  437. FUNCTION Q3XDrawRegion_StartAccessToImageBuffer(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr; VAR image: UNIV Ptr): TQ3Status; C;
  438. {
  439.  *    This function is used to indicate that access to a DrawRegion is ended.
  440.  }
  441. FUNCTION Q3XDrawRegion_End(drawRegion: TQ3XDrawRegion): TQ3Status; C;
  442. FUNCTION Q3XDrawRegion_GetDeviceTransform(drawRegion: TQ3XDrawRegion; VAR deviceTransform: TQ3Matrix4x4Ptr): TQ3Status; C;
  443. FUNCTION Q3XDrawRegion_GetClipFlags(drawRegion: TQ3XDrawRegion; VAR clipMaskState: TQ3XClipMaskState): TQ3Status; C;
  444. FUNCTION Q3XDrawRegion_GetClipMask(drawRegion: TQ3XDrawRegion; VAR clipMask: TQ3BitmapPtr): TQ3Status; C;
  445. {$IFC TARGET_OS_MAC }
  446. FUNCTION Q3XDrawRegion_GetClipRegion(drawRegion: TQ3XDrawRegion; VAR rgnHandle: RgnHandle): TQ3Status; C;
  447. FUNCTION Q3XDrawRegion_GetGDHandle(drawRegion: TQ3XDrawRegion; VAR gdHandle: GDHandle): TQ3Status; C;
  448. {$ENDC}  {TARGET_OS_MAC}
  449.  
  450. FUNCTION Q3XDrawRegion_GetRendererPrivate(drawRegion: TQ3XDrawRegion; VAR rendererPrivate: UNIV Ptr): TQ3Status; C;
  451. FUNCTION Q3XDrawRegion_SetRendererPrivate(drawRegion: TQ3XDrawRegion; rendererPrivate: UNIV Ptr; deleteMethod: TQ3XDrawRegionRendererPrivateDeleteMethod): TQ3Status; C;
  452. FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; flag: TQ3Boolean): TQ3Status; C;
  453. FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; VAR useDefaultRenderingFlag: TQ3Boolean): TQ3Status; C;
  454.  
  455.  
  456. {*****************************************************************************
  457.  **                                                                             **
  458.  **                            Renderer Class Methods                             **
  459.  **                                                                             **
  460.  ****************************************************************************}
  461. {
  462.  *    Methods from Object
  463.  *        kQ3XMethodTypeObjectClassRegister
  464.  *        kQ3XMethodTypeObjectClassUnregister
  465.  *        kQ3XMethodTypeObjectNew
  466.  *        kQ3XMethodTypeObjectDelete
  467.  *        kQ3XMethodTypeObjectRead
  468.  *        kQ3XMethodTypeObjectTraverse
  469.  *        kQ3XMethodTypeObjectWrite
  470.  *        
  471.  *    Methods from Shared
  472.  *        kQ3MethodTypeSharedEdited
  473.  *
  474.  *    Renderer Methods
  475.  *    
  476.  *    The renderer methods should be implemented according to the type
  477.  *    of renderer being written.
  478.  *
  479.  *    For the purposes of documentation, there are two basic types of
  480.  *    renderers: 
  481.  *
  482.  *        Interactive
  483.  *            Interactive Renderer
  484.  *            WireFrame Renderer
  485.  *        
  486.  *        Deferred
  487.  *            a ray-tracer
  488.  *            painter's algorithm renderer (cached in a BSP triangle tree)
  489.  *            an artistic renderer (simulates a pencil drawing, etc.)
  490.  *
  491.  *    The main difference is how each renderer handles incoming state and 
  492.  *    geometry.
  493.  *
  494.  *    An interactive renderer immediately transforms, culls, and shades
  495.  *    incoming geometry and performs rasterization. For example, in a 
  496.  *    single-buffered WireFrame renderer, you will see a new triangle
  497.  *    immediately after Q3Triangle_Draw (if it's visible, of course).
  498.  *
  499.  *    A deferred renderer caches the view state and each geometry, 
  500.  *    converting into any internal queue of drawing commands. Rasterization
  501.  *    is not actually performed until all data has been submitted.
  502.  *    
  503.  *    For example, a ray-tracer may not rasterize anything until the
  504.  *    end of the rendering loop, or until an EndFrame call is made.
  505.  }
  506.  
  507. {*****************************************************************************
  508.  **                                                                             **
  509.  **                        Renderer User Interface Methods                         **
  510.  **                                                                             **
  511.  ****************************************************************************}
  512. {
  513.  *    kQ3XMethodTypeRendererIsInteractive
  514.  *    
  515.  *    There is no actual method with this - the metahandler simply returns
  516.  *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  517.  *  intended to be used in interactive settings, and   
  518.  *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  519.  *  
  520.  *  If neither value is specified in the metahandler, the renderer 
  521.  *  is *assumed to be non-interactive*!!!
  522.  *    
  523.  *    OPTIONAL
  524.  }
  525.  
  526. CONST
  527.     kQ3XMethodTypeRendererIsInteractive = 'isin';
  528.  
  529.  
  530. {
  531.  *    TQ3XRendererModalConfigureMethod
  532.  *    
  533.  *    This method should pop up a modal dialog to edit the renderer settings 
  534.  *    found in the renderer private. 
  535.  *    
  536.  *    dialogAnchor - is platform specific data passed by the client to support
  537.  *      movable modal dialogs. 
  538.  *    MacOS: this is a callback to the calling application's event handler.
  539.  *      The renderer calls this function with events not handled by the 
  540.  *      settings dialog. This is necessary in order to support movable modal 
  541.  *      dialogs. An application's event handler must return kQ3True if it 
  542.  *      handles the event passed to the callback or kQ3False if not. 
  543.  *      An application which doesn't want to support a movable modal configure
  544.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  545.  *      A renderer should implement a non-movable style dialog in that case.
  546.  *    Win32: this is the HWND of the owning window (typically an application's
  547.  *      main window).  (Win32 application modal dialogs are always movable.)
  548.  *  canceled - returns a boolean inditacating that the user canceled the 
  549.  *    dialog.
  550.  *    
  551.  *    OPTIONAL
  552.  }
  553.     kQ3XMethodTypeRendererModalConfigure = 'rdmc';
  554.  
  555.  
  556. TYPE
  557. {$IFC TYPED_FUNCTION_POINTERS}
  558.     TQ3XRendererModalConfigureMethod = FUNCTION(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean; rendererPrivate: UNIV Ptr): TQ3Status; C;
  559. {$ELSEC}
  560.     TQ3XRendererModalConfigureMethod = ProcPtr;
  561. {$ENDC}
  562.  
  563. {
  564.  *    kQ3XMethodTypeRendererGetNickNameString
  565.  *    
  566.  *        Allows an application to collect the name of the renderer for
  567.  *        display in a user interface item such as a menu.
  568.  *    
  569.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  570.  *        bytes of a data buffer large enough to store the renderer name. 
  571.  *
  572.  *      bufferSize is the actual size of the memory block pointed to by 
  573.  *        dataBuffer
  574.  *
  575.  *        actualDataSize - on return the actual number of bytes written to the
  576.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  577.  *
  578.  *    OPTIONAL
  579.  }
  580.  
  581. CONST
  582.     kQ3XMethodTypeRendererGetNickNameString = 'rdns';
  583.  
  584.  
  585. TYPE
  586. {$IFC TYPED_FUNCTION_POINTERS}
  587.     TQ3XRendererGetNickNameStringMethod = FUNCTION(VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  588. {$ELSEC}
  589.     TQ3XRendererGetNickNameStringMethod = ProcPtr;
  590. {$ENDC}
  591.  
  592. {
  593.  *    kQ3XMethodTypeRendererGetConfigurationData
  594.  *    
  595.  *        Allows an application to collect private configuration data from the
  596.  *      renderer which it will then save. For example in a preference file, 
  597.  *      a registry key (on Windows) or in a style template. An application 
  598.  *      should tag this data with the renderer's object name.
  599.  *    
  600.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  601.  *        bytes of a data buffer large enough to store private data. 
  602.  *
  603.  *      bufferSize is the actual size of the memory block pointed to by 
  604.  *        dataBuffer
  605.  *
  606.  *        actualDataSize - on return the actual number of bytes written to the
  607.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  608.  *
  609.  *    OPTIONAL
  610.  }
  611.  
  612. CONST
  613.     kQ3XMethodTypeRendererGetConfigurationData = 'rdgp';
  614.  
  615.  
  616. TYPE
  617. {$IFC TYPED_FUNCTION_POINTERS}
  618.     TQ3XRendererGetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  619. {$ELSEC}
  620.     TQ3XRendererGetConfigurationDataMethod = ProcPtr;
  621. {$ENDC}
  622.  
  623. {
  624.  *    TQ3XRendererSetConfigurationDataMethod
  625.  *    
  626.  *        Allows an application to pass private configuration data which has
  627.  *         previously  been obtained from a renderer via 
  628.  *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  629.  *        in a style template. An application should tag this data with the 
  630.  *        renderer's object name.
  631.  *    
  632.  *      bufferSize is the actual size of the memory block pointed to by 
  633.  *        dataBuffer
  634.  *
  635.  *    OPTIONAL
  636.  }
  637.  
  638. CONST
  639.     kQ3XMethodTypeRendererSetConfigurationData = 'rdsp';
  640.  
  641.  
  642. TYPE
  643. {$IFC TYPED_FUNCTION_POINTERS}
  644.     TQ3XRendererSetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  645. {$ELSEC}
  646.     TQ3XRendererSetConfigurationDataMethod = ProcPtr;
  647. {$ENDC}
  648.  
  649. {*****************************************************************************
  650.  **                                                                             **
  651.  **                        Renderer Drawing State Methods                         **
  652.  **                                                                             **
  653.  ****************************************************************************}
  654. {
  655.  *    TQ3RendererStartFrame
  656.  *    
  657.  *    The StartFrame method is called first at Q3View_StartRendering
  658.  *    and should:
  659.  *        - initialize any renderer state to defaults
  660.  *        - extract any and all useful data from the drawContext
  661.  *
  662.  *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  663.  *    registration, then it should also:
  664.  *        - clear the drawContext 
  665.  *    
  666.  *        When clearing, your renderer may opt to:
  667.  *        - NOT clear anything (if you touch every pixel, for example)
  668.  *        - to clear with your own routine, or
  669.  *        - to use the draw context default clear method by calling 
  670.  *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  671.  *        any available hardware in the system for clearing.
  672.  *    
  673.  *    This call also signals the start of all default submit commands from
  674.  *    the view. The renderer will receive updates for the default view
  675.  *    state via its Update methods before StartPass is called.
  676.  *    
  677.  *    REQUIRED
  678.  }
  679.  
  680. CONST
  681.     kQ3XMethodTypeRendererStartFrame = 'rdcl';
  682.  
  683.  
  684. TYPE
  685. {$IFC TYPED_FUNCTION_POINTERS}
  686.     TQ3XRendererStartFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  687. {$ELSEC}
  688.     TQ3XRendererStartFrameMethod = ProcPtr;
  689. {$ENDC}
  690.  
  691. {
  692.  *    kQ3XMethodTypeRendererStartPass
  693.  *    TQ3XRendererStartPassMethod
  694.  *    
  695.  *    The StartPass method is called during Q3View_StartRendering but after
  696.  *    the StartFrame command. It should:
  697.  *        - collect camera and light information
  698.  *    
  699.  *    If your renderer supports deferred camera transformation, camera is the
  700.  *    main camera which will be submitted in the hierarchy somewhere. It
  701.  *    is never NULL.
  702.  *
  703.  *    If your renderer does not support deferred camera transformation, camera
  704.  *    is the transformed camera.
  705.  *
  706.  *    If your renderer supports deferred light transformation, lights will be
  707.  *    NULL, and will be submitted to your light draw methods instead.
  708.  *
  709.  *    This call signals the end of the default update state, and the start of 
  710.  *  submit commands from the user to the view.
  711.  *
  712.  *    REQUIRED
  713.  }
  714.  
  715. CONST
  716.     kQ3XMethodTypeRendererStartPass = 'rdst';
  717.  
  718.  
  719. TYPE
  720. {$IFC TYPED_FUNCTION_POINTERS}
  721.     TQ3XRendererStartPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  722. {$ELSEC}
  723.     TQ3XRendererStartPassMethod = ProcPtr;
  724. {$ENDC}
  725.  
  726. {
  727.  *    kQ3XMethodTypeRendererFlushFrame
  728.  *    TQ3XRendererFlushFrameMethod
  729.  *    
  730.  *    This call is only implemented by asynchronous renderers.
  731.  *    
  732.  *    The FlushFrame method is called between the StartPass and EndPass
  733.  *    methods and is called when the user wishes to flush any asynchronous
  734.  *    drawing tasks (which draw to the drawcontext), but does not want 
  735.  *    to block.
  736.  *    
  737.  *    The result of this call is that an image should "eventually" appear
  738.  *    asynchronously.
  739.  *    
  740.  *    For asynchronous rendering, this call is non-blocking.
  741.  *    
  742.  *    An interactive renderer should ensure that all received
  743.  *    geometries are drawn in the image.
  744.  *    
  745.  *    An interactive renderer that talks to hardware should force
  746.  *    the hardware to generate an image.
  747.  *    
  748.  *    A deferred renderer should exhibit a similar behaviour,
  749.  *    though it is not required.  A deferred renderer should spawn
  750.  *    a process that generates a partial image from the currently
  751.  *    accumulated drawing state. 
  752.  *    
  753.  *    However, for renderers such as ray-tracers which generally are
  754.  *    quite compute-intensive, FlushFrame is not required and is a no-op.
  755.  *
  756.  *    OPTIONAL
  757.  }
  758.  
  759. CONST
  760.     kQ3XMethodTypeRendererFlushFrame = 'rdfl';
  761.  
  762.  
  763. TYPE
  764. {$IFC TYPED_FUNCTION_POINTERS}
  765.     TQ3XRendererFlushFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  766. {$ELSEC}
  767.     TQ3XRendererFlushFrameMethod = ProcPtr;
  768. {$ENDC}
  769.  
  770. {
  771.  *    kQ3XMethodTypeRendererEndPass
  772.  *    TQ3XRendererEndPassMethod
  773.  *    
  774.  *    The EndPass method is called at Q3View_EndRendering and signals
  775.  *    the end of submit commands to the view.
  776.  *
  777.  *    If an error occurs, the renderer should call Q3XError_Post and
  778.  *    return kQ3ViewStatusError.
  779.  *    
  780.  *    If a renderer requires another pass on the renderering data,
  781.  *    it should return kQ3ViewStatusRetraverse.
  782.  *    
  783.  *    If rendering was cancelled, this function will not be called
  784.  *    and the view will handle returning kQ3ViewStatusCancelled;
  785.  *    
  786.  *    Otherwise, your renderer should begin completing the process of 
  787.  *    generating the image in the drawcontext. If you have buffered
  788.  *    any drawing data, flush it. RendererEnd should have a similar
  789.  *    effect as RendererFlushFrame.
  790.  *    
  791.  *    If the renderer is synchronous:
  792.  *        - complete rendering of the entire frame
  793.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  794.  *            - Update the front buffer
  795.  *        else
  796.  *            - DrawContext will update the front buffer after returning
  797.  *
  798.  *    If the renderer is asynchronous
  799.  *        - spawn rendering thread for entire frame
  800.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  801.  *            - you must eventually update the front buffer asynchronously
  802.  *        else
  803.  *            - you must eventually update the back buffer asynchronously
  804.  *            
  805.  *    REQUIRED
  806.  }
  807.  
  808. CONST
  809.     kQ3XMethodTypeRendererEndPass = 'rded';
  810.  
  811.  
  812. TYPE
  813. {$IFC TYPED_FUNCTION_POINTERS}
  814.     TQ3XRendererEndPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3ViewStatus; C;
  815. {$ELSEC}
  816.     TQ3XRendererEndPassMethod = ProcPtr;
  817. {$ENDC}
  818.  
  819. {
  820.  *    kQ3XMethodTypeRendererEndFrame
  821.  *    TQ3XRendererEndFrame
  822.  *    
  823.  *    This call is only implemented by asynchronous renderers.
  824.  *
  825.  *    The EndFrame method is called from Q3View_Sync, which is
  826.  *    called after Q3View_EndRendering and signals that the user
  827.  *    wishes to see the completed image and is willing to block.
  828.  *    
  829.  *    If your renderer supports kQ3RendererFlagDoubleBuffer
  830.  *        - update the front buffer completely 
  831.  *    else
  832.  *        - update the back buffer completely
  833.  *
  834.  *    This call is equivalent in functionality to RendererFlushFrame
  835.  *    but blocks until the image is completed.
  836.  *    
  837.  *    If no method is supplied, the default is a no-op.
  838.  *    
  839.  *    NOTE: Registering a method of this type indicates that your renderer will
  840.  *    be rendering after Q3View_EndRendering has been called.
  841.  *    
  842.  *    OPTIONAL
  843.  }
  844.  
  845. CONST
  846.     kQ3XMethodTypeRendererEndFrame = 'rdsy';
  847.  
  848.  
  849. TYPE
  850. {$IFC TYPED_FUNCTION_POINTERS}
  851.     TQ3XRendererEndFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  852. {$ELSEC}
  853.     TQ3XRendererEndFrameMethod = ProcPtr;
  854. {$ENDC}
  855.  
  856. {
  857.  *    The RendererCancel method is called after Q3View_StartRendering
  858.  *    and signals the termination of all rendering operations.
  859.  *
  860.  *    A renderer should clean up any cached data, and cancel all 
  861.  *    rendering operations.
  862.  *    
  863.  *    If called before Q3View_EndRendering, the RendererEnd method
  864.  *    is NOT called.
  865.  *    
  866.  *    If called after Q3View_EndRendering, the renderer should kill
  867.  *    any threads and terminate any further rendering.
  868.  *    
  869.  *    REQUIRED
  870.  }
  871.  
  872. CONST
  873.     kQ3XMethodTypeRendererCancel = 'rdab';
  874.  
  875.  
  876. TYPE
  877. {$IFC TYPED_FUNCTION_POINTERS}
  878.     TQ3XRendererCancelMethod = PROCEDURE(view: TQ3ViewObject; rendererPrivate: UNIV Ptr); C;
  879. {$ELSEC}
  880.     TQ3XRendererCancelMethod = ProcPtr;
  881. {$ENDC}
  882.  
  883. {*****************************************************************************
  884.  **                                                                             **
  885.  **                        Renderer DrawContext Methods                         **
  886.  **                                                                             **
  887.  ****************************************************************************}
  888. {
  889.  *    kQ3XMethodTypeRendererPush
  890.  *    TQ3XRendererPushMethod
  891.  *    
  892.  *    kQ3XMethodTypeRendererPop
  893.  *    TQ3XRendererPopMethod
  894.  *    
  895.  *    These methods are called whenever the graphics state in the view
  896.  *    is pushed or popped. The user may isolate state by calling:
  897.  *    
  898.  *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  899.  *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  900.  *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  901.  *    Q3Box_Submit(&unitBox, view);
  902.  *    Q3TranslateTransform_Submit(&unitVector, view);
  903.  *    Q3Push_Submit(view);
  904.  *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  905.  *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  906.  *        Q3Box_Submit(&unitBox, view);
  907.  *    Q3Pop_Submit(view);    
  908.  *    Q3TranslateTransform_Submit(&unitVector, view);
  909.  *    Q3Box_Submit(&unitBox, view);
  910.  *    
  911.  *    or by submitting a display group which pushes and pops.
  912.  *    
  913.  *    If you support RendererPush and RendererPop in your renderer:
  914.  *        - you must maintain your drawing state as a stack, as well.
  915.  *        - you will not be updated with the popped state after
  916.  *            RendererPop is called.
  917.  *
  918.  *    If you do not support Push and Pop in your renderer:
  919.  *        - you may maintain a single copy of the drawing state.
  920.  *        - you will be updated with changed fields after the view stack is
  921.  *            popped.
  922.  *
  923.  *    A renderer that supports Push and Pop gets called in the following
  924.  *    sequence (from example above):
  925.  *    
  926.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  927.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  928.  *    RendererUpdateAttributeSpecularColor(&white,...)
  929.  *    RendererUpdateMatrixLocalToWorld(...)
  930.  *    RendererSubmitGeometryBox(...)
  931.  *    RendererPush(...)
  932.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  933.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  934.  *        RendererSubmitGeometryBox(...)
  935.  *    RendererPop(...)
  936.  *    RendererUpdateMatrixLocalToWorld(...)
  937.  *    RendererSubmitGeometryBox(...)
  938.  *
  939.  *    A renderer that does not supports Push and Pop gets called in the
  940.  *    following sequence:
  941.  *    
  942.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  943.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  944.  *    RendererUpdateAttributeSpecularColor(&white,...)
  945.  *    RendererUpdateMatrixLocalToWorld(...)
  946.  *    RendererSubmitGeometryBox(...)
  947.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  948.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  949.  *        RendererSubmitGeometryBox(...)
  950.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  951.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  952.  *    RendererUpdateMatrixLocalToWorld(...)
  953.  *    RendererSubmitGeometryBox(...)
  954.  *    
  955.  }
  956.  
  957. CONST
  958.     kQ3XMethodTypeRendererPush    = 'rdps';
  959.  
  960.  
  961. TYPE
  962. {$IFC TYPED_FUNCTION_POINTERS}
  963.     TQ3XRendererPushMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  964. {$ELSEC}
  965.     TQ3XRendererPushMethod = ProcPtr;
  966. {$ENDC}
  967.  
  968.  
  969. CONST
  970.     kQ3XMethodTypeRendererPop    = 'rdpo';
  971.  
  972.  
  973. TYPE
  974. {$IFC TYPED_FUNCTION_POINTERS}
  975.     TQ3XRendererPopMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  976. {$ELSEC}
  977.     TQ3XRendererPopMethod = ProcPtr;
  978. {$ENDC}
  979.  
  980. {*****************************************************************************
  981.  **                                                                             **
  982.  **                            Renderer Cull Methods                             **
  983.  **                                                                             **
  984.  ****************************************************************************}
  985. {
  986.  *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  987.  *    TQ3XRendererIsBoundingBoxVisibleMethod
  988.  *    
  989.  *    This method is called to cull complex groups and geometries 
  990.  *    given their bounding box in local space.
  991.  *    
  992.  *    It should transform the local-space bounding box coordinates to
  993.  *    frustum space and return a TQ3Boolean return value indicating
  994.  *    whether the box appears within the viewing frustum.
  995.  *    
  996.  *    If no method is supplied, the default behavior is to return
  997.  *    kQ3True.
  998.  *    
  999.  }
  1000.  
  1001. CONST
  1002.     kQ3XMethodTypeRendererIsBoundingBoxVisible = 'rdbx';
  1003.  
  1004.  
  1005. TYPE
  1006. {$IFC TYPED_FUNCTION_POINTERS}
  1007.     TQ3XRendererIsBoundingBoxVisibleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR bBox: TQ3BoundingBox): TQ3Boolean; C;
  1008. {$ELSEC}
  1009.     TQ3XRendererIsBoundingBoxVisibleMethod = ProcPtr;
  1010. {$ENDC}
  1011.  
  1012.  
  1013. {*****************************************************************************
  1014.  **                                                                             **
  1015.  **                        Renderer Object Support Methods                         **
  1016.  **                                                                             **
  1017.  ****************************************************************************}
  1018. {
  1019.  *    Drawing methods (Geometry, Camera, Lights)
  1020.  *
  1021.  }
  1022. {
  1023.  *    Geometry MetaHandler
  1024.  *    
  1025.  *    This metaHandler is required to support 
  1026.  *    
  1027.  *    kQ3GeometryTypeTriangle
  1028.  *    kQ3GeometryTypeLine
  1029.  *    kQ3GeometryTypePoint
  1030.  *    kQ3GeometryTypeMarker
  1031.  *    kQ3GeometryTypePixmapMarker
  1032.  *    
  1033.  *    REQUIRED
  1034.  }
  1035.  
  1036. CONST
  1037.     kQ3XMethodTypeRendererSubmitGeometryMetaHandler = 'rdgm';
  1038.  
  1039.  
  1040. TYPE
  1041. {$IFC TYPED_FUNCTION_POINTERS}
  1042.     TQ3XRendererSubmitGeometryMetaHandlerMethod = FUNCTION(geometryType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1043. {$ELSEC}
  1044.     TQ3XRendererSubmitGeometryMetaHandlerMethod = ProcPtr;
  1045. {$ENDC}
  1046.  
  1047. {
  1048.  *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1049.  *    of kQ3GeometryTypeFoo and returns methods of type:
  1050.  }
  1051. {$IFC TYPED_FUNCTION_POINTERS}
  1052.     TQ3XRendererSubmitGeometryMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; geometry: TQ3GeometryObject; publicData: UNIV Ptr): TQ3Status; C;
  1053. {$ELSEC}
  1054.     TQ3XRendererSubmitGeometryMethod = ProcPtr;
  1055. {$ENDC}
  1056.  
  1057. {
  1058.  *    Camera MetaHandler
  1059.  *    
  1060.  *    This metaHandler, if supplied, indicates that your renderer
  1061.  *    handles deferred transformation of the main camera within a scene.
  1062.  *    
  1063.  *    If not supplied, or an unsupported camera is used, the view will do
  1064.  *    the transformation for the renderer and pass in a camera in the 
  1065.  *    StartPass method.
  1066.  *    
  1067.  *    OPTIONAL
  1068.  }
  1069.  
  1070. CONST
  1071.     kQ3XMethodTypeRendererSubmitCameraMetaHandler = 'rdcm';
  1072.  
  1073.  
  1074. TYPE
  1075. {$IFC TYPED_FUNCTION_POINTERS}
  1076.     TQ3XRendererSubmitCameraMetaHandlerMethod = FUNCTION(cameraType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1077. {$ELSEC}
  1078.     TQ3XRendererSubmitCameraMetaHandlerMethod = ProcPtr;
  1079. {$ENDC}
  1080.  
  1081. {
  1082.  *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1083.  *    of kQ3CameraTypeFoo and returns methods of type:
  1084.  }
  1085. {$IFC TYPED_FUNCTION_POINTERS}
  1086.     TQ3XRendererSubmitCameraMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; publicData: UNIV Ptr): TQ3Status; C;
  1087. {$ELSEC}
  1088.     TQ3XRendererSubmitCameraMethod = ProcPtr;
  1089. {$ENDC}
  1090.  
  1091. {
  1092.  *    Light MetaHandler
  1093.  *    
  1094.  *    This metaHandler, if supplied, indicates that your renderer
  1095.  *    handles deferred transformation of lights within a scene.
  1096.  *    
  1097.  *    If an unsupported light is encountered, it is ignored.
  1098.  *
  1099.  *    OPTIONAL
  1100.  }
  1101.  
  1102. CONST
  1103.     kQ3XMethodTypeRendererSubmitLightMetaHandler = 'rdlg';
  1104.  
  1105.  
  1106. TYPE
  1107. {$IFC TYPED_FUNCTION_POINTERS}
  1108.     TQ3XRendererSubmitLightMetaHandlerMethod = FUNCTION(lightType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1109. {$ELSEC}
  1110.     TQ3XRendererSubmitLightMetaHandlerMethod = ProcPtr;
  1111. {$ENDC}
  1112.  
  1113. {
  1114.  *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1115.  *    of kQ3LightTypeFoo and returns methods of type:
  1116.  }
  1117. {$IFC TYPED_FUNCTION_POINTERS}
  1118.     TQ3XRendererSubmitLightMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; light: TQ3LightObject; publicData: UNIV Ptr): TQ3Status; C;
  1119. {$ELSEC}
  1120.     TQ3XRendererSubmitLightMethod = ProcPtr;
  1121. {$ENDC}
  1122.  
  1123. {
  1124.  *
  1125.  *    Update methods
  1126.  *
  1127.  *    They are called whenever the state has changed. If the renderer supports
  1128.  *    the RendererPush and RendererPop methods, it must maintain its own state
  1129.  *    stack. Updates are not called for changed data when the view stack is
  1130.  *    popped.
  1131.  *
  1132.  *    See the comments for the RendererPush and RendererPop methods above
  1133.  *    for an example of how data is updated.
  1134.  *
  1135.  }
  1136. {
  1137.  *    Style
  1138.  }
  1139.  
  1140. CONST
  1141.     kQ3XMethodTypeRendererUpdateStyleMetaHandler = 'rdyu';
  1142.  
  1143.  
  1144. TYPE
  1145. {$IFC TYPED_FUNCTION_POINTERS}
  1146.     TQ3XRendererUpdateStyleMetaHandlerMethod = FUNCTION(styleType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1147. {$ELSEC}
  1148.     TQ3XRendererUpdateStyleMetaHandlerMethod = ProcPtr;
  1149. {$ENDC}
  1150.  
  1151. {
  1152.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1153.  *    of kQ3StyleTypeFoo and returns methods of type:
  1154.  }
  1155. {$IFC TYPED_FUNCTION_POINTERS}
  1156.     TQ3XRendererUpdateStyleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1157. {$ELSEC}
  1158.     TQ3XRendererUpdateStyleMethod = ProcPtr;
  1159. {$ENDC}
  1160.  
  1161. {
  1162.  *    Attributes
  1163.  }
  1164.  
  1165. CONST
  1166.     kQ3XMethodTypeRendererUpdateAttributeMetaHandler = 'rdau';
  1167.  
  1168.  
  1169. TYPE
  1170. {$IFC TYPED_FUNCTION_POINTERS}
  1171.     TQ3XRendererUpdateAttributeMetaHandlerMethod = FUNCTION(attributeType: TQ3AttributeType): TQ3XFunctionPointer; C;
  1172. {$ELSEC}
  1173.     TQ3XRendererUpdateAttributeMetaHandlerMethod = ProcPtr;
  1174. {$ENDC}
  1175.  
  1176. {
  1177.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1178.  *    of kQ3AttributeTypeFoo and returns methods of type:
  1179.  }
  1180. {$IFC TYPED_FUNCTION_POINTERS}
  1181.     TQ3XRendererUpdateAttributeMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1182. {$ELSEC}
  1183.     TQ3XRendererUpdateAttributeMethod = ProcPtr;
  1184. {$ENDC}
  1185.  
  1186. {
  1187.  *    Shaders
  1188.  }
  1189.  
  1190. CONST
  1191.     kQ3XMethodTypeRendererUpdateShaderMetaHandler = 'rdsu';
  1192.  
  1193.  
  1194. TYPE
  1195. {$IFC TYPED_FUNCTION_POINTERS}
  1196.     TQ3XRendererUpdateShaderMetaHandlerMethod = FUNCTION(shaderType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1197. {$ELSEC}
  1198.     TQ3XRendererUpdateShaderMetaHandlerMethod = ProcPtr;
  1199. {$ENDC}
  1200.  
  1201. {
  1202.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1203.  *    of kQ3ShaderTypeFoo and returns methods of type:
  1204.  }
  1205. {$IFC TYPED_FUNCTION_POINTERS}
  1206.     TQ3XRendererUpdateShaderMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; VAR shaderObject: TQ3Object): TQ3Status; C;
  1207. {$ELSEC}
  1208.     TQ3XRendererUpdateShaderMethod = ProcPtr;
  1209. {$ENDC}
  1210.  
  1211. {
  1212.  *    Matrices
  1213.  }
  1214.  
  1215. CONST
  1216.     kQ3XMethodTypeRendererUpdateMatrixMetaHandler = 'rdxu';
  1217.  
  1218.  
  1219. TYPE
  1220.     TQ3XRendererUpdateMatrixMetaHandlerMethod = TQ3XMetaHandler;
  1221. {
  1222.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1223.  *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1224.  }
  1225.  
  1226. CONST
  1227.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorld = 'ulwx';
  1228.  
  1229.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse = 'ulwi';
  1230.  
  1231.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose = 'ulwt';
  1232.  
  1233.     kQ3XMethodTypeRendererUpdateMatrixLocalToCamera = 'ulcx';
  1234.  
  1235.     kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum = 'ulfx';
  1236.  
  1237.     kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum = 'uwfx';
  1238.  
  1239. {
  1240.  *    and returns methods of type:
  1241.  }
  1242.  
  1243. TYPE
  1244. {$IFC TYPED_FUNCTION_POINTERS}
  1245.     TQ3XRendererUpdateMatrixMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  1246. {$ELSEC}
  1247.     TQ3XRendererUpdateMatrixMethod = ProcPtr;
  1248. {$ENDC}
  1249.  
  1250.  
  1251. {$ALIGN RESET}
  1252. {$POP}
  1253.  
  1254. {$SETC UsingIncludes := QD3DRendererIncludes}
  1255.  
  1256. {$ENDC} {__QD3DRENDERER__}
  1257.  
  1258. {$IFC NOT UsingIncludes}
  1259.  END.
  1260. {$ENDC}
  1261.